<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片下载</title>
</head>
<body>
    <button onclick="downloadImgFn()">下载图片</button>
    <script>
        const useFetch = async (url) => {
            const res = await fetch(url).then(res => res.arrayBuffer())
            console.log(res)
            const a = document.createElement('a')
            a.href = URL.createObjectURL(new Blob([res],{
                // type:"image/png"
            }))
            a.download = 'mingle.zip'
            a.click()
        }
        var downloadImgFn = function() {
            useFetch('http://localhost:3001/upload/getimg2?url=/uploadimgs/1663429943571.jpeg')
        }  
    </script>
</body>
</html>